import os
size = 0
def get_dir_size(target_dir):
    global size
    d_list = os.listdir(target_dir)
    print(d_list)
    for f in d_list:
        f = os.path.join(target_dir, f)
        if os.path.isfile(f):
            size += os.path.getsize(f)
        if os.path.isdir(f):
            get_dir_size(f)
    return size
dir_size = get_dir_size(r'C:\Users\Administrator\Desktop\个人简历')
print('总的大小:',dir_size)








